<?php
require_once 'modules/content/models/Content.php';
class default_IndexController extends Nine_Controller_Action
{
	public function indexAction()
	{
		/**
		 * Display tempalte
		 */
	    $this->view->headTitle('Home');
	    $this->view->menuId = 'home';
	    $this->setLayout('home');
	    
	    
	    $objContent = new Models_Content();
	    
	    $allFeatureContents = $objContent->getAllEnabledContentByCategory(3,array(),'content_gid DESC',6,0);
	    
	    /**
	     * Modified
	     */
	    foreach ($allFeatureContents as &$content) {
	    	if (null != @$content['intro_text']) {
	    		$content['intro_text'] = Nine_Function::subStringAtBlank($content['intro_text'], 100);
	    	} else {
	    		if (null != @$content['full_text']) {
	    			$content['intro_text'] = Nine_Function::subStringAtBlank($content['full_text'], 100);
	    		}
	    	}
	    }
	    unset($content);
	    
	    $this->view->allFeatureContents = Nine_Function::arrayChunkFixed($allFeatureContents,3);
	}
}